home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / d / devioustools19.dms / devioustools19.adf / utils / 009.lzx / Insert_File.macro < prev    next >
Text File  |  1979-01-11  |  2KB  |  68 lines

  1. /* Final Writer Include File Macro
  2.  
  3.     12/12/92
  4.     W.PURSEL
  5.  
  6. (modified 12/26/93 by David Jarvis, for use in Final Writer)
  7.  
  8. Final Writer does not incorporate an 'include file' 
  9. function.  This macro tries to provide that capability.
  10.  
  11. The following assumptions are made:
  12.  
  13. 1) The Final Writer window open has the document loaded that
  14.    you want to incorporate other text into.
  15.  
  16. 2) The cursor is placed at the location where you want to include
  17.    the new file.
  18.  
  19. 3) The file you are including is either another Final Writer document or
  20.    an ASCII file.  If you are including text from an ASCII file, you 
  21.    should establish your ASCII I/O preferences as needed.  
  22.  
  23. */
  24. /* $VER: Insert_File 2.0 W.Pursell/dlj (26.12.93)        */
  25.  
  26. hostname = address()          /* Get host name                             */
  27.  
  28. listb = ''                    /* Get list of all open Final Writer windows */
  29. answer = show(Ports)          /* before opening include text               */                            
  30. do while answer ~= ''
  31.   parse var answer . "FINALW." windownum answer
  32.   if windownum ~= '' then do
  33.     listb = listb || '-' || windownum
  34.   end
  35. end
  36.  
  37. Open                         /* Get file requestor to open new file     */
  38.  
  39. lista = ''                   /* Get list of all open Final Writer windows */
  40. quit = 0                     /* after OPEN                              */
  41. do while ~quit
  42.   answer = show(Ports)
  43.   do while answer ~= ''
  44.     parse var answer . "FINALW." windownum answer
  45.     if windownum ~= '' then do
  46.       lista = lista || '-' || windownum
  47.     end
  48.   end
  49.  
  50.   if lista ~= listb then quit = 1   /* End loop when new host shows up   */
  51.   else lista = ''
  52.  
  53. end
  54.  
  55. newwin = right(lista,1)      /* Get most recent Final Writer host number */ 
  56.  
  57. interpret "ADDRESS" "FINALW."newwin  /* Talk to new host number        */
  58.  
  59. SelectAll                    /* Select all the text                    */
  60. Cut                          /* Cut the text to the clipboard          */
  61. Close force                  /* Get rid of the new window              */
  62.  
  63. interpret "ADDRESS" hostname /* Talk to the original window again      */
  64.  
  65. Paste                        /* Paste the clipboard text at the cursor */ 
  66.  
  67. Exit
  68.